Added an AdaptiveCooperator strategy. #1477
Added an AdaptiveCooperator strategy. #1477cjgwang wants to merge 10 commits intoAxelrod-Python:devfrom
Conversation
|
So the build is failing because: I see that what you have written follows the documentation perfectly but that looks to be out of date (this is a documentation bug). If you take a look at a similar test file for example here you'll see that in fact the import needs to be: If you fix that and push it hopefully that fixes the error. |
|
Just fixed the TestPlayer class and pushed again - checks still failed. I think this has to do with the classifier, since |
drvinceknight
left a comment
There was a problem hiding this comment.
So it looks like you used an incorrect classification key.
Co-authored-by: Vince Knight <vince@vknight.org>
Co-authored-by: Vince Knight <vince@vknight.org>
|
I tried again and it doesn't seem to work. It looks like the test is failing because of test coverage, but when I added some more tests, it still fails! |
|
You're right, it's coverage but there are also some tests that are failing. Coverage From the log: Line 53 is not being hit when running the tests: That implies that we don't have a test which checks this specific set of conditions. Test failures There are some remaining tests that are not passing. One of them is for example: I believe this is because you have not reset all the attributes in the rest method: should be: although I think that you could remove the method completely and it will use the parent class There are a few other failures that are in the doctests but also some more in the unit tests that I'd need to look at a bit more closely. You might find running the tests locally helpful so that you can iterate this a bit more quickly. There is some information on doing that here: https://axelrod.readthedocs.io/en/stable/how-to/contributing/running_tests.html For example to just run the test file for your strategy you could run: |
Was unable to run
python rebuild_classifier_table.pydue to network issues, but the rest should be correct. I created adaptive_cooperator.py, test_adaptive_cooperator.py, made changes to the doctest, references, and _strategy.py.